package com.chixing.day10_hashcode_exception.homework;

import java.util.Locale;

public class LetterAnagrams {


    public static boolean letterAnagram(String a, String b){
        if (a.length() != b.length() && a.length()<1 && b.length()>5*104) {
            return false;
        }


        for (int j = 0; j <a.length() ; j++) {
            char a1= a.charAt(j);
            char b1= b.charAt(j);
            if (!(Character.isLowerCase(a1)&&Character.isLowerCase(b1)))
                return false;
        }
        int temp=0;
        for (int i = 0; i < b.length(); i++) {
            String c = b.substring(i,i+1);
            if (a.contains(b.substring(i,i+1))){
                temp=temp+1;
                return true;
            }
        }
        return false;
    }


    public static void main(String[] args) {

        System.out.println(letterAnagram("aNagram","nagaram"));
    }


}
